(function($) {
	$.jsonengine = {
			_url     : 'http://localhost:8888/_je/',
			_docType : '',
			_filter  : [],
			_sort    : [],
			_limit   : '',
			_offset  : '',
			_data    : '',
			_success : function(data, dataType){},
			_error   : function(xhr, textStatus, errorThrown){},
			_complete: function(xhr, textStatus){},
			_result  : {}
	}
	$.jsonengine.scopeTest = function(type) {
		var success = function(data, dataType){
			console.log('finish: success():')
			for(var i in data){
				$('body').append(data[i].val+'<br/>');
			}
		}
		this._success = success;
		var complete = function(xhr, textStatus){
			console.log('finish: complete():')
			if(textStatus=='success')
			try {
				$.jsonengine._result = $.parseJSON(xhr.responseText);
			} catch(e) {
			}
		}
		this._complete = complete;
		$.ajax({
			async   : false,
			type    : type,
			url     : this._url + this._docType,
			data    : this._data,
			success : this._success,
			error   : this._error,
			complete: this._complete
		});
		return $.jsonengine._result;
	}
	$.fn.extend({
		jsonengine : $.jsonengine
	});
})(jQuery);

$(function() {
	$.jsonengine._docType='testData200';
	$.jsonengine.scopeTest('GET')
	console.log($.jsonengine._result);
});
